CygNet Studio > Using CygNet Studio Tools and Controls > Properties, Events, and Methods > Methods

Methods

This section describes the methods applicable to Studio tools.

Method Description

AboutBox

The AboutBox method displays an About dialog box for the control.

AddItem

The AddItem method adds an item to the combo box along with an associated value.

AddPoint

The AddPoint method adds a new point record, given a service name (PNT, UIS or CVS) and a list of point attributes/value pairs. The list of point attributes provided must include the minimum set (as specified in the XML schema) to establish a valid point record. The minimum set is comprised of the SITE, SERVICE, Long Point ID, and/or Facility ID and Uniform Data Code.

AddSeriesDialog

The AddSeriesDialog method calls the Series dialog box where you can add a new series to your trend.

AddString

The AddString method adds an item and returns the index position at which the item was added.

AlarmAcknowledge

The AlarmAcknowledge method acknowledges an alarm.

Cancel

The Cancel method closes an object and TheView.

CaptureMouse

The CaptureMouse method forces mouse events to fire. While the mouse is being captured, mouse events will continue to fire on the capturing entity regardless of current mouse position. This function better facilitates dragging objects on views, such as splitters to allow for more flexible layout capabilities. Automatically released on left mouse button release. Context menus are not displayed while capturing. If the function is called on a windowed tool, the function sets capture to that window. If called on a non-windowed tool, it sets capture to The View and tracks which tool is "captured," altering its mouse event functions to always fire for that tool until released.

Clear

The Clear method clears the contents and values of the object.

ClearDataAll

 

ClearFocus

The ClearFocus method removes keyboard and mouse focus from child controls.

ClearMenu

The ClearMenu method clears all custom items from the context menu.

Syntax

ClearMenu()

Parameters
  • This method takes no parameters.
Return Values
  • This method returns no values.

ClearNoteSelection

ClearNoteSelection deselects every note label in a Trend Tool.

ClearObjectMenu

 

ClearViewMenu

 

DeleteAllSeries

The DeleteAllSeries method removes all series from a trend.

DeleteItem

The DeleteItem method deletes the item at the specified index. If the index is not found, all items remain unchanged.

DeleteSeries

The DeleteSeries method deselects trend(s) from a check list that was created by using the Microsoft ListView control.

DeleteString

The DeleteString method deletes the item at the specified index. Returns the number of items remaining in the list. If the index is not found, all items remain unchanged, and -1 is returned.

DeselectAll

The DeselectAll method clears selection of all tools and controls on TheView. See [ContextMenuAutoSelect] for more information.

EditAxesDialog

The EditAxesDialog method calls the Axis Configuration dialog where you can edit an axis in the trend.

EditItem

The EditItem method replaces the current item associated with the given value with a new string. If the value is not found, all items remain unchanged.

EditPoint

 

EditSeriesDialog

The EditSeriesDialog method calls the Series dialog box where you can edit a series in the trend.

Export

The Export method exports the contents of the grid to a temporary CSV file and opens the file with the default spreadsheet viewer for the user to view and save to disk.

ExportAsImage

The ExportAsImage method allows export of an image of a trend.

ExportToXml

The ExportToXml method dumps the data in the dictionary to an XML string.

FacilityConfig

 

FindObject

The FindObject method returns the index of the object with the given object code. Returns -1 if the object is not found.

FormFind

The FormFind method returns a handle to another screen with the given form code (set with the (FormCode) property).

GetAlarmLimitInfoXml

The GetAlarmLimitInfoXml method returns an XML string of the trend’s alarm limit configuration.

GetAxisById

The GetAxisById method returns the configured (XML) axis index number for a given axis ID number.

GetCount

The GetCount method returns the number of items in the box. Same as GetNumItems.

GetCurSel

The GetCurSel method returns the index of the current selection.

GetDisplayedNotes

GetDisplayedNotes returns an array of DisplayNote objects that are currently displayed in the view window of the Trend Tool.

GetDlgCtrlID

The GetDlgCtrlID method returns the numeric resource identifier of the control within TheView.

GetGroup

The GetGroup method returns the object group to which an object belongs, and returns null if the object does not belong to a group. The GroupID property returns the GroupID. Calling GetGroup is equivalent to calling TheView GetGroupByID and passing the value of the object’s GroupID property, and is provided for convenience.

GetGroupByID

The GetGroupById method returns a reference to the actual object group for a given GroupID. The same thing that you would get if you referenced the group directly by name in script.

GetLineCount

The GetLineCount method returns the number of lines of text in the edit box.

GetLineOfText

The GetLineOfText method returns the line of text at the specified line index. Line indexing is zero-based. If the line does not contain text, an empty string is returned.

GetNumItems

The GetNumItems method returns the number of items in the box. Same as GetCount().

GetObject

The GetObject method returns a handle to an object on TheView with the given index. Use the FindObject method to get an object’s index.

GetPoint

The GetPoint method returns point data for an object.

GetPointX

The GetPointX method returns the distance from the left edge of TheView of the given point. Points are indexed 0 to N-1, where N is the number of points on the path (see the NumberOfPoints method below).

GetPointY

The GetPointY method returns the distance from the top edge of TheView of the given point. Points are numbered 0 to N-1, where N is the number of points on the path (see the NumberOfPoints method below).

GetSelectedAlarmLimitSeries

The GetSelectedAlarmLimitSeries method returns an index of series currently selected to have its alarm limits displayed.

GetSelectedNote

The GetSelectedNote method returns the SITE.SERVICE~NOTENUMBER of the currently selected note label. A note's database key with no preceding zeroes makes up NOTENUMBER.

Syntax

GetSelectedNote() As String

Parameters
  • This method takes no parameters.
Return Values
  • This method returns the SITE.SERVICE~NOTENUMBER of the selected note. If no note is selected, the method returns an empty string.

See also Notes.

GetSelectedText

The GetSelectedText method returns the text currently in the box.

GetTemplateXml

The GetTemplateXml method returns properties in XML format without Point Tag specifiers.

GetText

The GetText method returns the text of the item at the given index. If the index is not found, this function returns an empty string.

GetValuesAtTime

The GetValuesAtTime method returns the value of a series at a time slice.

GetWindowText

The GetWindowText method returns the text currently in the box.

GUIEvent

 

GUIEventAll

 

HistoryAlarms

The HistoryAlarms method calls the Alarm History dialog box, which shows the alarm history of an individual alarm, and provides options for showing only particular types of alarm events. See Alarm History for more information.

HistoryAlarmsByRow

 

HistoryConfig

 

HistoryPause

 

HistoryPlayFwd

 

HistoryPlayRev

 

HistoryStepFwd

 

HistoryStepRev

 

HistoryStop

 

HistoryValues

The HistoryValues method calls the History Values dialog box, which shows all the history records for a given point, including additional information if the history name came from the PNT. See History Records for more information.

HistoryValuesByRow

 

HyperLink

The HyperLink method opens a new view window at the given file path (standard or BLOB). The SiteService and Facility properties of the new screen can be set using the parameters. Use "" for these parameters if you don’t want to specify a site, service, and/or facility. Returns a value indicating success (True) or failure (False) of the function.

HyperLinkAndClose

The HyperLinkAndClose method opens a new view window at the given file path (standard or BLOB) and closes the current view. If the file was not found, a message box displays, and the current view remains open. The SiteService and Facility properties of the new screen can be set using the parameters. Use "" for these parameters if you don’t want to specify a site, service, and/or facility. Returns a value indicating success (True) or failure (False) of the function.

HyperLinkEx

The HyperLinkEx method opens a new view window at the given file path (standard or BLOB). Optionally, this method closes the current view and/or opens multiple instances of the same studio screen. In contrast, the Hyperlink method will only allow you to have one instance of the called window open at a time. The SiteService and Facility properties of the new screen can be set using the parameters. Use "" for these parameters if you don’t want to specify a site, service, and/or facility. Set the CloseCallingScreen property to True to close the calling screen. Set the OpenMultipleInstances property to True to allow the method to open a new instance of the called screen. Returns a value indicating success (True) or failure (False) of the function.

HyperLinkSys

See EventHyperLinkSys for more information.

ImportFromXml

The ImportFromXml method loads data from the dictionary object in XML form. The Boolean parameter in ImportFromXml determines whether or not duplicate points will be replaced from the stored XML.

ImportScriptFile

The ImportScriptFile method provides built-in support for importing separate script files directly in script, facilitating faster screen initialization. The method is declared in the Declarations section of the screen. It takes in two parameters:

  • The first parameter is the file name of the script file you want to import.
  • The second parameter is a variant, which can be either a string or an array of strings of folder paths where the script files are located. The folder paths can be either a CygNet APPS or BSS folder or local or network Windows file-system folder. Optionally, you can include a Blob file in a BSS on a different domain.

Example

fileName = "Global.txt"

filePath = "[10003]CYGDEMO.BSS\Include\" or "C:\Scripts\Include"

'(Declarations)

 

TheView.ImportScriptFile fileName, ucase(filePath)

 

'End of (Declarations)

IncrValue

The IncrValue method toggles the value (checked or unchecked) of the check box.

InsertString

The InsertString method inserts an item at the given index. All subsequent items are pushed up by one index number. Returns -1 if the index is not found, otherwise returns the index.

IsBlobFileNew

 

IsBlobFileOld

 

IsBlobFileSizeDiff

 

IsFormOpen

The IsFormOpen method returns True if a form with the given FormCode is currently open, otherwise returns False.

IsSelected

The IsSelected method indicates if the tool or control is selected. Can be used with [ContextMenuAutoSelect].

LayerName

The LayerName method gets the name of the layer on which the object resides.

ListGroupIDs

The ListGroupIDs method returns a list of the GroupIDs for the objects groups on the screen.

Maximize

The Maximize method maximizes the trend. When entering maximization mode, the Maximize parameter value passed in is "True." When exiting maximization mode, the Maximize parameter value passed in is "False."

Move

The Move method moves an object by the specified amount, relative to its current position.

NotifySelChange

The NotifySelChange method forces a complete refresh of the tool and any connected/affected objects. For example, when used with a Group Navigation Bar, NotifySelChange forces a filter change on a Group Navigation Bar to apply to an associated Group Grid object.

NotifySelChangeLevel

 

NumberOfPoints

The NumberOfPoints method returns the number of points in the path. A point is considered to be a location at which the path changes direction, or an end point.

OnUpdate

The OnUpdate method updates the control to ensure that any property modifications have taken effect.

OnUpdateResize

The OnUpdateResize method updates the control to ensure that any modifications to its boundary have taken effect.

OnUpdateStyle

The OnUpdateStyle method updates the control to ensure that any modifications to its style properties have taken effect.

OpenDoc

The OpenDoc method opens a .csf screen file at the given location. Nothing happens if the file is not found.

OpenView

 

PointConfigAlarmSettings

 

PointConfigAlarmSettingsByRow

 

PointConfigAlarmSuppression

 

PointConfigAlarmSuppressionByRow

 

PointConfigAll

 

PointConfigAllByRow

 

PointConfigComments

 

PointConfigCommentsByRow

 

PointConfigQuestionable

 

PointConfigQuestionableByRow

 

Print

The Print method prints the contents of the control, grid, or viewer. When this method is called, the Print dialog box is shown to allow configuration.

PrintToDefaultPrinter

The PrintToDefaultPrinter method prints a trend grid to the default printer.

PumpData

This method is not used.

PumpDataAll

 

RaiseCustomEvent

 

RaiseMyCustomEvent

 

ReadFromFile

The ReadFromFile method reads the trend from a file.

Record

This method is not used.

Refresh

The Refresh method refreshes the contents of the control from the Current Value Service (CVS).

RefreshTargetData

 

RegisterPointForChangeNotice

The RegisterPointForChangeNotice method registers an unrelated point on a screen that may change its value. Used in conjunction with EventPointChange.

RemoveMenuItem

 

RemoveObjectMenuItem

The RemoveObjectMenuItem method removes an item from the context menu.

Example

Sub

Dim This : Set This = TheView

This.RemoveObjectMenuItem "CYG_ALARMSUPPRESSION"

End Sub

RemovePoint

 

RemoveViewMenuItem

 

ResetContent

The ResetContent method clears all of the items in the box.

Restart

For objects, the Restart method stops and restarts Run mode. For TheFrame/TheView, the Restart method restarts TheView with new site, service, and facility information, if applicable. See also RestartSoft.

RestartSoft

For the Group Grid Tool and Trend Tool, the RestartSoft method stops and restarts Run mode. For TheFrame/TheView, the RestartSoft method restarts TheView with new site, service, and facility information, if applicable. See also Restart.

RunChange

The RunChange method runs the object’s EventChange event code.

RunClick

The RunClick method runs the object’s EventClick event code.

RunInitialize

The RunInitialize method runs the object’s EventInitialize event code.

RunPumpData

This method is not used.

RunTerminate

The RunTerminate method runs TheView’s EventTerminate event code.

SendSharedMessage

The SendSharedMessage method on the TheView sends a message to another instance of CygNet Studio or CygNet Vision. The method contains three parameters:

Parameters
Parameter Required Description

messageId

Yes

The ID used to categorize the message.

data

Yes

The body of the message.

true/false

No

An optional Boolean parameter to indicate whether or not the application sender instance should also receive the shared message (true or false).

  • If set to true then all the Studio/Vision instances will receive the shared message including the sender instance.
  • If set to false then all the Studio/Vision instances will receive the shared message except the sender instance.

Example

'(Declarations)

 

Sub SendIPCMessage(messageId, data)

' send a message to all other Studio/Vision instances running on this machine

TheView.SendSharedMessage messageId, data, false

End Sub

 

'End of (Declarations)

 

 

Sub SendSharedMessageButton_EventClick()

 

Dim This : Set This = SendSharedMessageButton

SendIPCMessage("CHANGE_LEVEL1_FACILITY", "MYSITE.UIS::MY_WELL")

 

End Sub

ScrollBackward

The ScrollBackward method scrolls the data window backward through trend time.

ScrollForward

The ScrollForward method scrolls the data window forward through trend time.

Select

The Select method selects the tool or control. "True" to select, "false" to deselect. Can be used with [ContextMenuAutoSelect].

SelectNote

SelectNote selects a note item in the Trend Tool. Both this method and the Note Feed Tool method SetSelection must be called in order for a Trend Tool and a Note Feed Tool to synchronize. This method fires this tool's EventNoteSelected event.

SetAlarmLimitInfoXml

The SetAlarmLimitInfoXml method sets the trend’s alarm limit configuration XML string.

SetCurSel

The SetCurSel method sets the current selection index. Returns -1 if the index is not found, otherwise returns the index.

SetEndPoints

The SetEndPoints method sets the position of the lines endpoints: (X1, Y1) and (X2, Y2). Distances are in pixels from the top and left edges of TheView.

SetFocus

The SetFocus method sets the focus to the control.

SetMaximizedCheck

The SetMaximizedCheck method sets the check next to the Maximized context menu item.

SetMenuItem

The SetMenuItem method is called to control an item in the context menu for the tool.

SetObjectMenuItem

 

SetObjectSubMenuItem

 

SetPoint

The SetPoint method sets the position of a point along the path. Point is the index of the point to set, numbered 0 to N-1. The values X and Y are the new left and top positions of the point.

SetSelectedAlarmLimitSeries

The SetSelectedAlarmLimitSeries method changes or sets the series for which to display alarm limits.

SetSubMenuItem

The SetSubMenuItem method is called to control an item in a nested sub-menu in the context menu for the tool.

The parameters that are passed in include:

  • EventID — The unique ID of the selected context menu item that is passed to the EventContextMenu event handler.
  • Description — The text string that is displayed in the context menu item.
  • ValidTagOnly — The context menu item is enabled only if the button or tool has a valid tag.
  • Disabled — Manually enable or disable the context menu item.

SetViewMenuItem

 

SetViewSubMenuItem

 

SetWindowText

The SetPoint method sets the text in the box to NewText.

ShowConfiguration

 

ShowCurrentValue

 

ShowCurrentValueByRow

 

ShowHistoryPlaybackBar

 

ShowMaximized

The ShowMaximized method displays the screen in maximized state.

ShowMinimized

The ShowMinimized method displays the screen in minimized state.

ShowPointList

 

ShowRestored

The ShowRestored method displays the screen in normal (restored) state.

TextValue

The TextValue method returns the text of the current selection.

TrendAddPoint

 

TrendAddPointByRow

 

TrendRemovePoint

 

TrendRemovePointByRow

 

TrendSinglePoint

 

TrendSinglePointByRow

 

TrendSinglePointRollup

 

TrendSinglePointRollupByRow

 

Update

 

UpdateUnits

 

UseCygNetMaximize

 

Value

The Value method gets the text of the currently selected item. Returns an empty string if no item is selected.

ViewTrend

 

WriteToFile

The WriteToFile method writes the trend to a file.

X

The X method returns an object that lists properties and methods specific to an ActiveX control. This method is only available for some ActiveX controls.

Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.